/**
 * 
 */
package us.gaaoc.framework.webapp.backingbeans.admin;

import javax.faces.context.FacesContext;

import us.gaaoc.framework.dao.ModelFacade;
import us.gaaoc.framework.dao.ModelFacadeHibernate;
import us.gaaoc.framework.model.Person;
import us.gaaoc.framework.webapp.backingbeans.BaseBackingBean;

/**
 * @author Sukhada
 * May 31, 2006
 * GAJE_BibbCounty_1.0
 */
public class DeleteUser extends BaseBackingBean{

	/**
	 * Property
	 */	
	private byte deleteUser;

	/**
	 * Constructor
	 *
	 */
	public DeleteUser() {
	}

	/**
	 * @return Returns the deleteUser.
	 */
	public byte getDeleteUser() {
		return deleteUser;
	}

	/**
	 * @param deleteUser The deleteUser to set.
	 */
	public void setDeleteUser(byte deleteUser) {
		this.deleteUser = deleteUser;
	}

	/**
	 * This method deletes case record from the list but in database its
	 * changing the flag as case record deleted
	 * @return String
	 */
	public String deleteUser(){
		Person deletePerson = (Person)this.getFacesContext().getExternalContext().getSessionMap().get("person");
		deletePerson.setDeleteUserFlag((byte)1);
    	this.getModelFacade().makePersistent(deletePerson);
    	
		return "deleteUser";
	}
}
